package com.zzx.boot.controller;

import com.zzx.boot.servlet.AdsenseService;
import com.zzx.boot.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tan
 * @version 1.0
 * @date 2023/7/9 22:11
 */
@RestController
@RequestMapping("/adsense")
@Api(tags = "广告模块")
@RequiredArgsConstructor
public class AdsenseController {

    private final AdsenseService adsenseService;

    @ApiOperation(value = "通过类型获取广告列表")
    @GetMapping("/{type}")
    public R getListByType(@PathVariable("type") Integer type){
        return R.success(adsenseService.getListByType(type));
    }


}
